import request from "@/utils/request"
const { dexh } = window.APP_GETEWAY
export default {
  // 内部导出
  export(url, data) {
    return request({
      baseURL: window.APP_GETEWAY.pms,
      url,
      method: "post",
      responseType: "blob",
      returnData: true,
      data,
    })
  },
  // 导出中心导出
  taskExport(data) {
    return request({
      baseURL: dexh,
      url: "/export_record",
      method: "post",
      data,
    })
  },
  // 获取单个配置
  getConfig(params) {
    return request({
      baseURL: dexh,
      url: "/export_config/one",
      method: "get",
      params,
    })
  },
  // 新增模板
  addTamplate(data) {
    return request({
      baseURL: dexh,
      url: "/export_tpl",
      method: "post",
      data,
    })
  },
  // 编辑模板
  editTamplate(id, data) {
    return request({
      baseURL: dexh,
      url: `/export_tpl/${id}`,
      method: "put",
      data,
    })
  },
  // 删除模板
  deleteTamplate(id) {
    return request({
      baseURL: dexh,
      url: `/export_tpl/${id}`,
      method: "delete",
    })
  },
}
